package main

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	dataCh := make(chan interface{})
	num := 10
	go func() {
		var wg sync.WaitGroup
		for i := 0; i < num; i++ {
			wg.Add(1)
			go func(ch chan interface{}) {
				defer wg.Done()
				time.After(time.Second)
				ch <- time.Now().Unix()
			}(dataCh)

		}
		wg.Wait()
		close(dataCh)
	}()
	resp := make([]interface{}, 0, num)
	for data := range dataCh {
		resp = append(resp, data)
	}
	fmt.Println(resp)
}
